import React, { PureComponent } from 'react';
import {
  Form,
  Modal,
} from 'antd';

import DescriptionList from '@/components/DescriptionList';
import { connect } from 'dva';

const { Description } = DescriptionList;

@connect(({ roleModels, loading }) => ({
  roleModels,
  loading: loading.models.roleModels,
}))
//查看详情
class DescView extends PureComponent {
  render() {
    const { roleModels: { roleDesc = {} }, handleLookDesc, lookDescView } = this.props;
    return (
      <Modal
        destroyOnClose
        title="查看用角色信息"
        visible={lookDescView}
        onOk={() => handleLookDesc(false, [])}
        onCancel={() => handleLookDesc(false, [])}>
        <DescriptionList size="large" style={{ marginBottom: 32 }} col={1}>
          <Description term="角色名称">{roleDesc.roleName}</Description>
          <Description term="角色编号">{roleDesc.roleNo}</Description>
          <Description term="状态">{roleDesc.status === 1 ? '启用' : '停用'}</Description>
          <Description term="创建时间">{roleDesc.createTime}</Description>
        </DescriptionList>
        <Description term="备注">{roleDesc.remark}</Description>
      </Modal>
    );
  }
};

export default DescView;
